<?php

namespace app\model;

use app\BaseModel;
use think\model\relation\BelongsTo;

class BackupsModel extends BaseModel
{
    protected $name = 'backups';

    /**
     * 关联用户
     * @return BelongsTo
     */
    public function user(): BelongsTo
    {
        return $this->belongsTo('UserModel','uid')->bind(['user_name'=>'name','role_id','role_name']);
    }

    public function getUserInfo(): BelongsTo
    {
        return $this->belongsTo('UserModel','uid')->bind(['user_name'=>'name']);
    }
}